
// 设置队伍阵法类型 {"名称":"普通"}
// @ts-ignore
export async function execute(client_id,message_json) {
    let name = message_json["名称"];
    let login_characters = G.Characters.get_current_login_characters(client_id);

    // 是否队长
    if (!login_characters["队长"]) {
        ClientUtils.send_basic_prompt(client_id, "只有队长才可进行此操作");
    } else {
        let team_data = G.TeamUtils.get_team_data(login_characters["队伍"]);
        if (team_data !== undefined) {
            let data = login_characters["阵法"][name];
            if (data === undefined) {
                ClientUtils.send_basic_prompt(client_id, "您尚未学会如何使用该阵法");
            } else {
                team_data["阵型"] = name;
                let send_data = G.TeamUtils.build_send_team_data(team_data["id"]);
                team_data["成员"].forEach(characters_id => {
                    let character_client_id = G.Characters.get_characters_client_id(characters_id);
                    if (character_client_id !== undefined) {
                        ClientUtils.send_client_message(character_client_id, 4004, send_data);
                    }
                });
                //通知所有队伍成员更新队伍信息
                ClientUtils.send_basic_prompt(client_id, "更改阵型成功！");

            }
        } else {
            ClientUtils.send_basic_prompt(client_id, "队伍不存在");
        }
    }
}
